package com.suneee.permission.entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

import com.suneee.orm.annotation.Column;
import com.suneee.orm.annotation.Entity;
import com.suneee.orm.annotation.GeneratedValue;
import com.suneee.orm.annotation.GenerationType;
import com.suneee.orm.annotation.Id;
import com.suneee.orm.annotation.Table;
import com.suneee.orm.annotation.Transient;

@Entity
@Table(name = "t_permission")
public class Permission implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -602721149611514507L;

	/**
	 * 唯一id
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="permission_id",nullable=false)
	private Integer permissionId;	
	
	/**
	 * 所属分组
	 */
	@Column(name="group_name")
	private String groupName;
	
	/**
	 * 显示类型(1菜单,2界面按钮,3列表行按钮)
	 */
	@Column(name="show_type")
	private Integer showType;
	
	/**
	 * 名称
	 */
	@Column(name="name",nullable=false)
	private String name;
	
//	/**
//	 * 类型
//	 */
//	@Column(name="type",nullable=false)
//	private String type;
	
	/**
	 * 编号
	 */
	@Column(name="code")
	private String code;
	
	/**
	 * app_code
	 */
//	@Column(name="app_code")
//	private String appCode;
	
	/**
	 * 启用/禁用
	 */
	@Column(name="enabled",nullable=false)
	private Integer enabled;
	
	/**
	 * url
	 */
	@Column(name="api_uri")
	private String uri;
	
	/**
	 * 备注
	 */
	@Column(name="remark")
	private String remark;
	
	/**
	 * 排序编码
	 */
	@Column(name="order_num")
	private Integer orderNum;
	
	/**
	 * 创建时间
	 */
	@Column(name="create_time")
	private Timestamp createTime;
	
	@Column(name="create_user")
	private String createUser;
	 
	
	@Column(name="update_time")
	private Timestamp updateTime;
	
	@Column(name="update_user")
	private String updateUser;
	
	/**
	 * 最近更新时间
	 */
//	@Column(name="last_update_time",nullable=false)
//	private Timestamp lastUpdateTime;
	
	/**
	 * 父编号
	 */
	@Column(name="parent_code")
	private String parentCode;
	@Transient
	private String parentName;
	@Transient
	private List<Permission> children;
	
	@Transient
	private boolean selected;
	
	@Column(name="icon")
	private String icon;
	
	@Transient
	private Integer level;
	
	/**
	 * 表示某一菜单下是否还有子菜单  0:没有,大于0 则有
	 */
	@Transient
	private Integer isChildren;
	
	
	
	public Integer getPermissionId() {
		return permissionId;
	}
	public void setPermissionId(Integer permissionId) {
		this.permissionId = permissionId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public Integer getEnabled() {
		return enabled;
	}
	public void setEnabled(Integer enabled) {
		this.enabled = enabled;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Integer getOrderNum() {
		return orderNum;
	}
	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}
	public Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	public String getParentCode() {
		return parentCode;
	}
	public void setParentCode(String parentCode) {
		this.parentCode = parentCode;
	}

	public List<Permission> getChildren() {
		return children;
	}
	public void setChildren(List<Permission> children) {
		this.children = children;
	}
	public boolean isSelected() {
		return selected;
	}
	public void setSelected(boolean selected) {
		this.selected = selected;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public Timestamp getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}
	public String getUpdateUser() {
		return updateUser;
	}
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
	public Integer getShowType() {
		return showType;
	}
	public void setShowType(Integer showType) {
		this.showType = showType;
	}
	public String getGroupName() {
		return groupName;
	}
	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	public String getUri() {
		return uri;
	}
	public void setUri(String uri) {
		this.uri = uri;
	}
	public Integer getLevel() {
		return level;
	}
	public void setLevel(Integer level) {
		this.level = level;
	}
	public Integer getIsChildren() {
		return isChildren;
	}
	public void setIsChildren(Integer isChildren) {
		this.isChildren = isChildren;
	}
	public String getParentName() {
		return parentName;
	}
	public void setParentName(String parentName) {
		this.parentName = parentName;
	}
}
